<?php


namespace app\dao;


use app\dao\query\HotelQueryDao;
use app\model\Hotel;

class HotelDao extends BaseDao
{
    private $_customQuery;

    public function __construct()
    {
        $this->_customQuery = new HotelQueryDao();
    }

    protected function setModel(): string
    {
        return Hotel::class;
    }

    public function customQuery()
    {
        return $this->_customQuery;
    }

    public function offHotel($id){
        return $this->edit($id , ['is_ban' => 1]);
    }

    public function onHotel($id){
        return $this->edit($id , ['is_ban' => 0]);
    }
}